\(\int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx\) [158]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 34 \[ \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx=-\frac {i \sec ^2(c+d x)}{2 a d}+\frac {\tan (c+d x)}{a d} \]

[Out]

-1/2*I*sec(d*x+c)^2/a/d+tan(d*x+c)/a/d

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {3171, 3169, 3852, 8, 2686, 30} \[ \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx=\frac {\tan (c+d x)}{a d}-\frac {i \sec ^2(c+d x)}{2 a d} \]

[In]

Int[Sec[c + d*x]^3/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

((-1/2*I)*Sec[c + d*x]^2)/(a*d) + Tan[c + d*x]/(a*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 3169

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Sym
bol] :> Int[ExpandTrig[cos[c + d*x]^m*(a*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] &&
 IntegerQ[m] && IGtQ[n, 0]

Rule 3171

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> Dist[a^n*b^n, Int[Cos[c + d*x]^m/(b*Cos[c + d*x] + a*Sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, m},
x] && EqQ[a^2 + b^2, 0] && ILtQ[n, 0]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \int \sec ^3(c+d x) (i a \cos (c+d x)+a \sin (c+d x)) \, dx}{a^2} \\ & = -\frac {i \int \left (i a \sec ^2(c+d x)+a \sec ^2(c+d x) \tan (c+d x)\right ) \, dx}{a^2} \\ & = -\frac {i \int \sec ^2(c+d x) \tan (c+d x) \, dx}{a}+\frac {\int \sec ^2(c+d x) \, dx}{a} \\ & = -\frac {i \text {Subst}(\int x \, dx,x,\sec (c+d x))}{a d}-\frac {\text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{a d} \\ & = -\frac {i \sec ^2(c+d x)}{2 a d}+\frac {\tan (c+d x)}{a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.82 \[ \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx=-\frac {i \tan (c+d x) (2 i+\tan (c+d x))}{2 a d} \]

[In]

Integrate[Sec[c + d*x]^3/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

((-1/2*I)*Tan[c + d*x]*(2*I + Tan[c + d*x]))/(a*d)

Maple [A] (verified)

Time = 0.59 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.68

method result size
risch \(\frac {2 i}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}\) \(23\)
derivativedivides \(-\frac {i \left (\frac {\tan \left (d x +c \right )^{2}}{2}+i \tan \left (d x +c \right )\right )}{d a}\) \(30\)
default \(-\frac {i \left (\frac {\tan \left (d x +c \right )^{2}}{2}+i \tan \left (d x +c \right )\right )}{d a}\) \(30\)
norman \(\frac {\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a d}-\frac {2 i \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{2}}\) \(74\)

[In]

int(sec(d*x+c)^3/(cos(d*x+c)*a+I*a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

2*I/d/a/(exp(2*I*(d*x+c))+1)^2

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.97 \[ \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx=\frac {2 i}{a d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d} \]

[In]

integrate(sec(d*x+c)^3/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="fricas")

[Out]

2*I/(a*d*e^(4*I*d*x + 4*I*c) + 2*a*d*e^(2*I*d*x + 2*I*c) + a*d)

Sympy [F]

\[ \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx=\frac {\int \frac {\sec ^{3}{\left (c + d x \right )}}{i \sin {\left (c + d x \right )} + \cos {\left (c + d x \right )}}\, dx}{a} \]

[In]

integrate(sec(d*x+c)**3/(a*cos(d*x+c)+I*a*sin(d*x+c)),x)

[Out]

Integral(sec(c + d*x)**3/(I*sin(c + d*x) + cos(c + d*x)), x)/a

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 108 vs. \(2 (30) = 60\).

Time = 0.22 (sec) , antiderivative size = 108, normalized size of antiderivative = 3.18 \[ \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx=\frac {2 \, {\left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {i \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{{\left (a - \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}\right )} d} \]

[In]

integrate(sec(d*x+c)^3/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="maxima")

[Out]

2*(sin(d*x + c)/(cos(d*x + c) + 1) - I*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - sin(d*x + c)^3/(cos(d*x + c) + 1)
^3)/((a - 2*a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a*sin(d*x + c)^4/(cos(d*x + c) + 1)^4)*d)

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.79 \[ \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx=-\frac {i \, \tan \left (d x + c\right )^{2} - 2 \, \tan \left (d x + c\right )}{2 \, a d} \]

[In]

integrate(sec(d*x+c)^3/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="giac")

[Out]

-1/2*(I*tan(d*x + c)^2 - 2*tan(d*x + c))/(a*d)

Mupad [B] (verification not implemented)

Time = 24.35 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.74 \[ \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx=-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (-2+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}{2\,a\,d} \]

[In]

int(1/(cos(c + d*x)^3*(a*cos(c + d*x) + a*sin(c + d*x)*1i)),x)

[Out]

-(tan(c + d*x)*(tan(c + d*x)*1i - 2))/(2*a*d)